133 research outputs found

    Efficient, Near Complete and Often Sound Hybrid Dynamic Data Race Prediction (extended version)

    Full text link
    Dynamic data race prediction aims to identify races based on a single program run represented by a trace. The challenge is to remain efficient while being as sound and as complete as possible. Efficient means a linear run-time as otherwise the method unlikely scales for real-world programs. We introduce an efficient, near complete and often sound dynamic data race prediction method that combines the lockset method with several improvements made in the area of happens-before methods. By near complete we mean that the method is complete in theory but for efficiency reasons the implementation applies some optimizations that may result in incompleteness. The method can be shown to be sound for two threads but is unsound in general. We provide extensive experimental data that shows that our method works well in practice.Comment: typos, appendi

    Aspect-Oriented Programming with Type Classes

    Get PDF
    We consider the problem of adding aspects to a strongly typed language which supports type classes. We show that type classes as supported by the Glasgow Haskell Compiler can model an AOP style of programming via a simple syntax-directed transformation scheme where AOP programming idioms are mapped to type classes. The drawback of this approach is that we cannot easily advise functions in programs which carry type annotations. We sketch a more principled approach which is free of such problems by combining ideas from intentional type analysis with advanced overloading resolution strategies. Our results show that type-directed static weaving is closely related to type class resolution -- the process of typing and translating type class programs

    Translating Generalized Algebraic Data Types to System F

    Get PDF
    Generalized algebraic data types (GADTs) extend ordinary algebraic data types by refining the types of constructors with syntactic equality constraints. This is highly useful and allows for novel applications such as strongly-typed evaluators, typed LR parsing etc. To translate GADTs we need to enrich the System F style typed intermediate languages of modern language implementations to capture these equality constraints. We show that GADTs can be translated to a minor extension of System F where type equality proofs are compiled into System F typable proof terms. At run-time proof terms evaluate to the identity. Hence, they can be safely erased before execution of the program. We provide evidence that our approach scales to deal with extensions where equality is not anymore syntactic. The benefit of our method is that type checking of target programs remains as simple as type checking in System F. Thus, we can offer a light-weight approach to integrate GADTs and extensions of it into existing implementations

    A Systematic Translation of Guarded Recursive Data Types to Existential Types

    Get PDF
    Guarded recursive data types (GRDTs) are a new language feature which allows to type check the different branches of case expressions under different type assumptions. We observe that GRDTs are pretty close in their typing behavior to type classes with existential types (TCET). We give a translation scheme from GRDTs to TCET. The translation to TCET might be ambiguous in the sense that common implementations such as the Glasgow Haskell Compiler (GHC) fail to accept the translated program. Hence, we provide for another translation from TCET to existential types (ET) which is accepted by GHC. To achieve this goal we combine an existing constraint solving procedure with a novel proof term construction method
    corecore